package components.tools.correction
{
	import UIFree.ObjectEvent;
	import UIFree.uif_ecomponent;
	
	import classes.clt_events;
	
	import components.uif_center100;
	
	import flash.events.Event;

	public class clt_manualCorrection extends clt_correctionBasePanel {
		private var _sb_red: uif_center100;
		private var _sb_green: uif_center100;
		private var _sb_blue: uif_center100;
		public function clt_manualCorrection(parent: uif_ecomponent, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0) {
			super(parent, ax, ay, awidth, aheight);
			parent.addEvent(clt_events.CLEAR, doClear);
		}
		
		protected function doClear(e: Event): void {
			_sb_red.value 	= 0;
			_sb_green.value = 0;
			_sb_blue.value 	= 0;
		}
		
		override protected function createComponents(): void {
			_sb_red 	= createScroll('Красный', 'sbRed');
			_sb_green	= createScroll('Зеленый', 'sbGreen');
			_sb_blue 	= createScroll('Синий', 'sbBlue');
		}

		override protected function doUpdate(e: Event): void {
			clt.workspace.dispatchEvent(new ObjectEvent(clt_events.MANUALCORR, [
				_sb_red.value,
				_sb_green.value,
				_sb_blue.value
			]));
		}
	}
}